//
//  BLLiveRoomItem.swift
//  BLLiveTelecast
//
//  Created by BigL055 on 16/5/30.
//  Copyright © 2016年 bigL.liveTelecast.com. All rights reserved.
//

import UIKit

class BLLiveRoomItem: NSObject {
    
    lazy var tag_name : String? = ""
    
    lazy var room_id : Int? = 0
    
    var tag_id : NSNumber?
        
    var room_list : [[String : AnyObject]] = [[:]]
    
    lazy var roomlistArray = [BLDouyuRoomDetalModal]()
    
    
    class func initWithDict(dict : [String : AnyObject]) -> BLLiveRoomItem{
        let item = BLLiveRoomItem()

        var isTagNil = false
        
        if dict["tag_id"] is String{
            isTagNil = true
        }
        
        item.setValuesForKeysWithDictionary(dict)
        
        //模型转换
        for dict in item.room_list{
            let tempItem = BLDouyuRoomDetalModal.initWithDict(dict)
            item.roomlistArray.append(tempItem)
        }
        
        if isTagNil {
            item.tag_id = -1
        }
        
        return item
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    
}
